<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta charset="utf-8" />
  <meta name="viewport" content="weidth=divice-width,initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <title>人事管理系统</title>
  <link rel="stylesheet" href="css/logins.css">
  <script src="/css/jquery-1.10.2.js"></script>
  <script src="https://use.fontawesome.com/152262a3b3.js"></script>
  <script type="text/javascript">
		eval("${errerMsg}");
  </script>
<title>登录</title>
</head>
<body>
  <div id="login-box">
    <h1>人事管理系统</h1>
    <!-- 获取当前项目路径hrm  ${pageContext.request.contextPath }/login -->
    <form method="post" action="${pageContext.request.contextPath }/login">
      <div class="form">
        <div class="item">
          <i class="fa fa-user-circle-o"></i>
          <input type="text" placeholder="Username" name="username" id="uname">
        </div>
        <div class="item">
          <i class="fa fa-key"></i>
          <input type="password" placeholder="Password" name="password" id="userpass">
        </div>
        <!-- 验证码 /hrm/CheckServlet -->
        <div class="item1">
          <i class="fa fa-check-square-o fa-lg" aria-hidden="true"></i>
          <input type="text" placeholder="请输入验证码" name="formCode" />
          <img src="/hrm/CheckServlet" height="30px" width="80px">
        </div>
        <br />
        <div class="login"><input type="submit" value="登录" class="login" onclick=" return checkSubmit()" />
        </div>
      </div>
    </form>
  </div>
  <script type="text/javascript">
    eval("${errerMsg}");
  </script>
  <script type="text/javascript">
    function checkSubmit() {
      var oUname = document.getElementById("uname");
      var oError = document.getElementById("userpass");
      var uerror = "";

      if (uname.value.length < 4 || umane.value.length > 20 || userpass.value.length < 4 || userpass.value.length > 20) {
        alert("输入不能为空，且长度不超过4-20");
        return false;
      }
      return true;
    }
  </script>
</body>

</html>